package com.vshining.cryptoki.jna;

import com.sun.jna.NativeLong;

/**
 * 更美观的String输出
 *
 * @author Shining Wang <shiningwang@vshining.com>
 */
@SuppressWarnings("unused")
public class ToString extends com.vshining.cryptoki.ToString {

    public static String toHexString(NativeLong[] nativeLongs) {
        if (nativeLongs == null) {
            return "null";
        }
        StringBuilder sb = new StringBuilder("[");
        for (int i = 0; i < nativeLongs.length; i++) {
            if (i != 0) {
                sb.append(", ");
            }
            sb.append(toHexString(nativeLongs[i].intValue()));
        }
        sb.append("]");
        return sb.toString();
    }
}
